package com.etong.citymap.util;

import java.text.DecimalFormat;

public class StringUtil {
	
	public static boolean IsNull(String string) {
		if(string==null||string.equals("")) {
			return true;
		}
		return false;
	}
	public static boolean IsNotNull(String string) {
		if(string==null||string.equals("")) {
			return false;
		}
		return true;
	}
	public static String format(Double d, Integer max ,Integer min) {  
        if(null == d){  
            return "";  
        }  
        Integer _min = (null == min || min < 0) ? 2 : min;  
        String pattern = "0";  
        DecimalFormat formatter = new DecimalFormat(pattern);  
        if (null != _min) {  
            formatter.setMinimumFractionDigits(_min);  
        }  
        if (null != max) {  
            formatter.setMaximumFractionDigits(max);  
        }  
        return formatter.format(d);  
    }  
}
